<template>
    <div>
        <div id="main" style="width:1000px;height:500px"></div>
    </div>
</template>

<script>

import * as echarts from 'echarts';

export default {
    name: 'EchartsView',
    data() {
        return {
            // key:[],
            // value:[],
        };
    },
    props: {},

    components: {},

    created() {},

    mounted() {
        this.top1();
        this.getsalary();
    },

    methods: {
        top1() {
            var chartDom = document.getElementById('main');
            var myChart = echarts.init(chartDom);
            var option;

            option = {
                xAxis: {
                    type: 'category',
                    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        data: [120, 200, 150, 80, 70, 110, 130],
                        type: 'bar',
                        showBackground: true,
                        backgroundStyle: {
                            color: 'rgba(180, 180, 180, 0.2)'
                        }
                    }
                ]
            };

            option && myChart.setOption(option);
        },
        
        getsalary(){
            // this.axios.get("/get/integral")
            // .then((resp) => {
            //     console.log("..",resp)
            //     this.key = resp.data.key
            //     this.value = resp.data.value
            //     this.top1();
            // }).catch((err) => {
            //     console.log(err)
            // });
        }

    },

    computed: {},

    watch: {},

    directives: {},

    filters: {}
};
</script>

<style scoped></style>
